package masterjava.common.client.gxt.base.model;

import com.extjs.gxt.ui.client.data.BaseModel;
import masterjava.common.shared.HasKey;

/**
 * User: gkislin
 * Date: 8/1/11
 */
public class GenericModel<D extends HasKey> extends BaseModel implements HasKey {
    public static final String KEY = "key";

    private final D data;

    public GenericModel(D data) {
        this.data = data;
        set(KEY, data.getKey());
    }

    @Override
    public String getKey() {
        return data.getKey();
    }

    public D getData() {
        return data;
    }
}
